--------------------------------------------------
-- @file src/kit/core/event/error.lua
-- @desc generate an error event
-- @author doooreyn
-- @date 2020.11.14
-- @sees src/kit/event/event.lua
-- @more 此文件生成一个错误事件
--------------------------------------------------
local proto = require("src.kit.core.proto")
local event = require("src.kit.core.event.event")
local mapping = require("src.kit.core.event.mapping")
local m = proto.class("error", event)

--
-- @method error.ctor
-- @desc constructor of class `error`
-- @param em string eventname
-- @param msg string error description
--
function m:ctor(em, msg, context)
    m.super.ctor(self, em, msg)
    self.level = mapping.level.error
    self.msg = msg
    self.context = context
end

return m
